<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app1">
        <com></com>
    </div>
    <div id="app2">
        <com></com>
        <com></com>
    </div>
    <template id="com">
        <div>
            <button>{{msg}}</button>
        </div>
    </template>
    <script src="../vue.js"></script>
    <script>
        //Vue.component('组件名称','组件配置项')
        Vue.component('com',{
            template:'#com',
            data () {
                return {
                    msg:'按钮',
                }
            }
        });
        let vm=new Vue().$mount('#app1');
        new Vue({el:'#app2'});
    </script>
</body>
</html>